package controller;

import java.util.Map;

/**
 * The Notification class encapsulates name, sender and an optional Map of arbitrary user info.
 * Classes that subscribe to a particular Notification may query the Notification
 * for its name. The sender instance variable allows interaction with the object
 * that issued this Notification. Additional data may optionally be delivered via
 * the userInfo Map.
 * @author nils
 *
 */
public class Notification {
	
	// A few predefined notification string constants:
	public final static String didGenerateTreeElement = "did generate tree element";
	public final static String didModify3dItem = "did modify item";
	public final static String didHide3dItem = "did hide item";
	public final static String didShow3dItem = "did show item";
	public final static String didModifyGeometry = "did modify geometry";
	
	public final static String resetVisualization = "reset visualization";
	public final static String willTraverseElement = "will traverse";
	public final static String didTraverseElement = "did traverse";
	public final static String didFindLeaf = "did find leaf";
	public final static String willReportAllLeaves = "will report leaves";
	public final static String doesNotIntersect = "does not intersect";
	public final static String didSelectSubtree = "did select subtree";
	
	public final static String didChangeForwardEnabledness = "forward enabledness";
	public final static String didChangeBackwardEnabledness = "backward enabledness";
	
	public String name;
	public Object sender;
	public Map<String, Object> userInfo;
	
	public Notification(String name, Object sender, Map<String, Object> userInfo) {
		this.name = name;
		this.sender = sender;
		this.userInfo = userInfo;
	}
}
